package fire.button;

import jgame.JGObject;
import jgame.platform.JREEngine;

public abstract class Button extends JGObject {

	public Button(String name,  double x, double y,
			int collisionid, String gfxname) {
		super(name, true, x, y, collisionid, gfxname);
	}

	@Override
	public void move() {
		if (checkCollision(10000, 0, 0) == 10000) {
			if (JREEngine.getKeyStatic(256)) {
				leftClick();
				return;
			}
			if (JREEngine.getKeyStatic(257)) {
				middleClick();
				return;
			}
			if (JREEngine.getKeyStatic(258)) {
				rightClick();
				return;
			}
			mouseInside();
		}
		else {
			mouseOutside();
		}
	}
	
	public abstract void mouseInside();
	
	public abstract void mouseOutside();

	public abstract void leftClick();

	public abstract void middleClick();

	public abstract void rightClick();
}
